UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AJJfQZ0ZADYSU8J7Hq3drFIRmc8xPj2YxufowzUgpDI='
WHERE
key_id = '98cc63ff8228f07deb6e3851dfaa9d7ee9b90d29aebefb7e9807527530c9b965'
AND (
token = 'AJJfQZ0ZADYSU8J7Hq3drFIRmc8xPj2YxufowzUgpDI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)