How to handle moving time window event in an embedded software
You can probably get an equivalent functionality using a exponential moving average. 

y[n]=αx[n]+(1−α)y[n−1]

Where α is your window.

X is >1 when the motor is on, and 0 when it's off. If X is >1 enough samples in the window time, Y will become true (>=1).

This can be calculated in fixed point maths by using factors of 2 for α.
More details from the neighbours.  

Note that a fixed point implementation might not yield a perfect 72000 seconds limit. But since you've given hours there is some flexibility.