Koying’s suggestion should do the trick and ensure a running boiler is turned off within 30 minutes of a restart.
Another option is to employ a 30-minute timer. However, all countdown-based facilities in Home Assistant (timer, delay, for, wait_for_template, etc) are subject to the same deficiency and are reset on startup (i.e. remaining countdown duration is lost). If you are interested, I created a means of restoring interrupted active/paused timers:
Basically, if an active 30-minute timer is interrupted 10 minutes into its countdown, and Home Assistant is offline for 15 minutes, when Home Assistant restarts, the 30-minute timer will be automatically restarted with the remaining duration: 30 - 10 - 15 = 5 minutes.
However, if you want a simple and effective backstop then use koying’s suggestion (implementing a timer-based solution is more work).