UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'G5NfMFmjrFIXkzQ1QUOuGUZaPyL2gGIGt/0lzhR/Npc='
WHERE
key_id = 'de7aa33e7aaf81c9a7143d9f001780be6ab4f31eaa6334bc60e3cfe5ffdf60ca'
AND (
token = 'G5NfMFmjrFIXkzQ1QUOuGUZaPyL2gGIGt/0lzhR/Npc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)