Ideally you would save the id_map from the first time you imported, you can then supply the same id_map to the import_from_csv_file function so it would update the records instead of inserting new ones. To save the id_map you can do something like this the first time you import
my_map = {}
db.your_table.import_from_csv(csvfile, my_map)
pickle.dump(my_map, pickle_file) # example of how to save id_map
Now my_map will hold the map, you can save it, for instance, using pickle. Next time you want to re-import the file with updates you can load the pickled my_map and use that as id_map. Ideally you would test for the pickle's file existence before doing it, and if you want to be absolutely sure you will use portalocker to avoid having more than one process trying to do imports and changing the pickled id_map.