UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rtPYrO47ZJoFzH6FG2beWO9KnZYSKA0Ri0vZeop3hDg='
WHERE
key_id = '6100e409828dab4b9c4a9186bc7f4421e98ab4b470f3dd6b70d5ce7f8bb6f21d'
AND (
token = 'rtPYrO47ZJoFzH6FG2beWO9KnZYSKA0Ri0vZeop3hDg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)