typically I load all the records I’m going to be working with at once, and assemble them into dictionaries or other data structures so that as I process the csv data, I can look things up in the local dictionary for the modify.
if the data you get from your CSV can all relate to the primary key of the objects, then you can use session.merge(), applying the existing primary key to a new object, which will be merged into the state of the existing row. This also emits a SELECT for those rows, but again if you load them up ahead of time, the check is against the local identity map.