By design, systemd will start and restart services by running the same commands, under the same environment, etc. either at boot time or during updates. Thus there is no direct way to know if a service is run at boot or restarted after an update. As an administrator, you can infer this by looking at the unit start time, logs, etc.
However, you can work around this by adding specific logic to your service unit, using for example:
Or you can run the command only at boot time using a systemd timer (see systemd.timer(5)) or good old