UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mlbRhytSCsTziqmvvsBnvjiLasTPnrX4EB+lvPAwy7U='
WHERE
key_id = 'ceed98074bee32abbc2b6d0b9924e0125a1ed1a38d98477e3be8836fe4a2686e'
AND (
token = 'mlbRhytSCsTziqmvvsBnvjiLasTPnrX4EB+lvPAwy7U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)