For long-running jobs which need to be killed after a timeout, and when you also need to ensure there is only ever a single instance, use something like this:
Where your command goes in place of the "/usr/bin/sleep 10" (If this is not immediately obvious, to see it in action, open two terminals on the same host, and try running the above command in both at the same time.)