UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aHQdUcrUtcrUXeR+iC9UElvqWHx332YnijzkNv3AqNg='
WHERE
key_id = 'cb5d89412717a9953db56c6a5d27d942c374aae6d8ba866222a80ec2616f828d'
AND (
token = 'aHQdUcrUtcrUXeR+iC9UElvqWHx332YnijzkNv3AqNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)