UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iTBiATQpvzMMqC0dy83Qx7Ika1FzIJVGfIWJhysUwbQ='
WHERE
key_id = '6c92f40ff7c64f3060e2a607649379835c2c3e8917cf5bf43ac79b8ea5a75065'
AND (
token = 'iTBiATQpvzMMqC0dy83Qx7Ika1FzIJVGfIWJhysUwbQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)