UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mFNlw52ALGBdvlkiRoiJ9RLKMMlMPL5ZMqasgX04l/M='
WHERE
key_id = 'b62e35a500f3a54bdfd747e10c0ec32df4a8b59c167257db1acbc47b0a4797de'
AND (
token = 'mFNlw52ALGBdvlkiRoiJ9RLKMMlMPL5ZMqasgX04l/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)