UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sF1A2/Wy3ez/l9j5lImYNQ4q4VsJyWEWw1sV/xfvp/E='
WHERE
key_id = '9d97b3fde74d3c7cab4ea5f5dbfbf3379f08b7596252bb5048638e120ed11d5a'
AND (
token = 'sF1A2/Wy3ez/l9j5lImYNQ4q4VsJyWEWw1sV/xfvp/E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)