UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LB7Z4p/udQwZ4v90AyY9i85DWIGTozHM5F2vAsuikxI='
WHERE
key_id = 'c90d457c60f1afc97b96c5fd61bcc06cc4b933d9de2dbc49ea92468ebb203617'
AND (
token = 'LB7Z4p/udQwZ4v90AyY9i85DWIGTozHM5F2vAsuikxI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)