UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DMzk07hyHzlulxElIgAX4Bj7MUSEgsAWfFK+cj6Iln0='
WHERE
key_id = '96eb0a9bf1f84e69e8d5509a548ebe8a28e1f9f9a40b5144851b489aa9dbc493'
AND (
token = 'DMzk07hyHzlulxElIgAX4Bj7MUSEgsAWfFK+cj6Iln0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)