lock update when queries are still running