I will assume you want the precondition rule solution, because it is simpler to implement. (precondition rules are set in the task properties of a workflow task, so you may need to add a workflow object to run your job if the job currently runs by itself.)
Here is an example precondition rule from our systems that checks for the completion of a specific object anytime in the previous 4 hours. If it has completed, the task is skipped. If it has not completed, then the task is executed. (In this use case, the step sends an email alarm to appropriate staff that a critical business process is late.) Your solution would be done similar to this.
And I strongly recommend running tests in a non production client.
https://us.v-cdn.net/5019921/uploads/editor/8p/zy3t9t1eiyea.png" width="515">