UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ofV722rUEAgHH0EyYhUomQdLaY+D1xXd0jQXxshLpVU='
WHERE
key_id = '962a785f1ad844e68382b6cfcf234c0bdde5382faab0cbd7a221f8e956dec1b8'
AND (
token = 'ofV722rUEAgHH0EyYhUomQdLaY+D1xXd0jQXxshLpVU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)