UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yVEHI3RAa2yO3nvGwAYYKiWuS9nHStoFxzdj7UlBZ5Q='
WHERE
key_id = '5641a0ffcf1519a400fd73f055a7dcf2b016c2535fc0a19f413fd3fcfcf6f801'
AND (
token = 'yVEHI3RAa2yO3nvGwAYYKiWuS9nHStoFxzdj7UlBZ5Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)