Prevent multiple job runs.

I have modified the query and added a foreach loop to update the nextrun time. This way, if a the cron is set to run every five minutes, and there are snippets set to run once a day, but it takes longer than 5 minutes to run those jobs, they wont run more than once in that day.