Add a way to remove lock from query.