UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RDNy5wP1340FAWdGUl123MkDuioQCG/y2zj3JV7VrCQ='
WHERE
key_id = '80351792d47340f4b2fbaf349d63ad97e1ef24fd7499522ff30fcf6bb7750b9d'
AND (
token = 'RDNy5wP1340FAWdGUl123MkDuioQCG/y2zj3JV7VrCQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)