UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MOnP7+qL/QhxyR8wX7eBY0TH9NhM1jHXlDfIRjKDVDM='
WHERE
key_id = '54725faf463b7540ecb31c89d0a1cafc4ad7f304af8aff37c2234eba56a8a3d0'
AND (
token = 'MOnP7+qL/QhxyR8wX7eBY0TH9NhM1jHXlDfIRjKDVDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)