The scenarios you are describing in your question acre actually two different use cases:
- Either you want time series data (data that is sent independently whether it has changed in specific intervals, e.g. every minute), or
- You want the latest data of your sensor, and only record the changes.
You need to decide which case you want to implement for your scenario, but it seems from your question that the second use case is what you want to implement.
What you propose in option 1) is not possible because the <contentInstance> resource type does not allow updates of an existing resource. Your only possibility with this resource is to create a new <contentInstance> every time you want to store data.
Also, you cannot provide, set or update the resourceIdentifier because it is always assigned by the CSE.
However, there are a couple of options to achieve what you want to do when you only need to store one data record per sensor. You should have a look at the <container> definition because here you can set the maximumNumberOfInstance (mni) attribute to 1. This means that the <container> always makes sure to store one instance of the data automatically (ie. it removes all the older instances). To access your data you would then not directly address the <contentInstance>, but use the <latest> virtual child resource of the <container>. When sending a RETRIEVE request to that resource you would automatically get the latest <contentInstance>, independently from its name or resource identifier.
Another possibility would be using <flexContainer>. Here, you can define you own data points and store data records without any versioning. But I am not sure whether the version of om2m you are using is fully supporting the <flexContainer> resource type.