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