Make values optional in prepared query