Status panel - base color on last measurement ager

Dear all, may I ask for help please? I use InfluxDB to store sensor data and I would like to see warning when no data has been received for some time. Lets say if age of last measurement is 1hr to have yellow panel and if age is 2hrs to have it red. How can I configure the expression please?

Do you also have some experience how to base panel color on EXIT status of linux command?

Thank you very much for response.