UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1qegO9YIKSFbnTG9HhwJIgMPUY/uRU/HQ6a7lJB8dCY='
WHERE
key_id = '73c2c35a45c32b5912c35b6ae8b7056ea72b51a9a993a88e8728b55caa0671de'
AND (
token = '1qegO9YIKSFbnTG9HhwJIgMPUY/uRU/HQ6a7lJB8dCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)