Adding a query with the same id as an old query should overwrite it

Updates weren't working properly here - the old version of the query was still
in the index and would still be run.