UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VNvA9UOiwE4ojgiBt/5GdKPPvtuZ4dIo8tcs4anE6AY='
WHERE
key_id = '7972b8c6961eb9c8cf1987fcc218f84d683d24948b3b7c367711595e5edeb884'
AND (
token = 'VNvA9UOiwE4ojgiBt/5GdKPPvtuZ4dIo8tcs4anE6AY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)