UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TAMzsANudA0Fnqiqcf1uV6eU08Jf5ad7HLW3CxoxrEQ='
WHERE
key_id = '05ff37449c7d20c61baa0abb0bd5ddc6aa5a34036ad4f8c64672fde014f117db'
AND (
token = 'TAMzsANudA0Fnqiqcf1uV6eU08Jf5ad7HLW3CxoxrEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)