UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xM85yFNcNjDl25rus5b0mIZjBtO8gPW4ADHhje5onSE='
WHERE
key_id = 'ebbcf9fcbf0d76966c9ca8852572a9d0e522934734a6c103c9f4d0a67cb45a0d'
AND (
token = 'xM85yFNcNjDl25rus5b0mIZjBtO8gPW4ADHhje5onSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)