The example you used at systemd is a bad example. It states to
Restart=always. That doesn't help to "fix" a buggy service that failed to run stable. It will only spam your system with starting attempts until it will give up after some minutes.
In particular for your case it doesn't fit because you need to run your service only one time at start up and do not need to be in the background and work continuously as a service/daemon. I suggest to try this Unit File that you create with:
rpi ~$ sudo systemctl --full --force edit UpTime.service
In the empty editor insert these statements, save them and quit the editor:
Description=Up Time logging
I don't know the real name of the mysql service. I have named it in this example
mysql.service. You have to use the correct name from your system. In general you can just look with
~$ systemctl what services are running. Enable your service with:
rpi ~$ sudo systemctl enable UpTime.service
and try with a reboot. It may not work on the first attempt because there are some additional environment settings are needed. We will look then.