One way is to create a job for SQL Server agent which would do the update on desired interval and your code would control if the job is enabled or not.
To create a job, have a look at
Create a Job[
^] and to toggle the enabled state, see
sp_update_job (Transact-SQL)[
^]
However, keep in mind that storing calculated values in the database is often not recommended.