UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'irozc8Ghy0w6dNrOVT0dyEQtZBeoGq5Fy+6eMaK3vuw='
WHERE
key_id = '3244fe072716ee8f9daf828d1e6b79890106f0960c7a033dc02c203ce924227e'
AND (
token = 'irozc8Ghy0w6dNrOVT0dyEQtZBeoGq5Fy+6eMaK3vuw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)