UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+Y+lTS4/FAUZCksdj1c+ctVmRzvJg8FS0G+XqkliJu4='
WHERE
key_id = '771a44ee816e860ae4493bd0fe6cecef02824f469a1060768d32c1abcbb66ed7'
AND (
token = '+Y+lTS4/FAUZCksdj1c+ctVmRzvJg8FS0G+XqkliJu4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)