UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4c2oeNKGSFbZxUgMeiO/5KXhnt8ZAXMBAUrKcCVyVFw='
WHERE
key_id = 'e3191db29dac38218adb18d4273c0cf3fe333dd58c3939aa15bb60369968fdd4'
AND (
token = '4c2oeNKGSFbZxUgMeiO/5KXhnt8ZAXMBAUrKcCVyVFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)