If I understand your question correctly, you are exporting existing records, adding more information from another source, and re-importing back into AtoM. This will require the import to match and update current records.
If you try this, do test it in a development environment on a vagrant box and not in your production environment!
The current implementation of the CSV import in AtoM assumes that the import data (all of it) comes from some other system and not roundtripping to update current records. This means that using csv import for updating purposes is risky, and not recommended. As I understand it, if matching in all fields between exported data and re-imported data is exact, it will update the current records. However, CSV will try to look at the key map table and look for foreign system IDs, but these will be AtoM IDs and the keymap matching will fail. Secondarily it will look at a combination of title, identifier, and repository. If none of these fields has been modified in any way, it should match and update.
Changing the way csv imports work would require development. Development on this CSV roundtripping has been proposed, but would have to be sponsored.
However, this doesn't answer your question about the SQL query! If you still intend to proceed, let us know and we will address the query.
Corinne Rogers, MAS, PhD