UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Zy7EfHREt0pHF9AFT5NLsuXWW9WW58jWg2YlBlNzWXE='
WHERE
key_id = '8a4e801cc6f67b2c6be9e3e87424bb9ee3586383ba36c9528077efad3b1aae63'
AND (
token = 'Zy7EfHREt0pHF9AFT5NLsuXWW9WW58jWg2YlBlNzWXE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)