Thread/Concurrency Safety in template sensors

Hello,
I have a template sensor that I use to track a value that can be incremented or decremented by a number of different triggers. This basically looks like:

{{ states(‘sensor.on_duration’)|int(0) + (as_timestamp(now(),0)|int(0) - states(‘sensor.last_start_timestamp’)|int(0)) }}

Is this a safe pattern? Is it possible that two triggers to this could create a condition where their operations get interleaved?