get newly created keyframe in python
The find curve by path and insert the keyframe is very common in Blender.

You may not need to find the any keyframe in Blender by key.  You can iterate through them and update a value such as curve type if the frame matches the frame in your inventory by frame number.

If you have potentially extra items you can remove(delete) the entire curve. 

Your concern about time efficiency ("costly") is good yet now may not be the time to optimize.

There is the [add] method documented here.

https://docs.blender.org/api/current/bpy.types.FCurveKeyframePoints.html#bpy.types.FCurveKeyframePoints