Garage opened within 45 seconds, unlock door inside garage, if not opened within 45 seconds open another door

Hey guys, im new to node red and trying to figure out the best way to handle this scenario. if my wife or I get home(presence detected via ha phone app), if we open the garage door within 45 seconds, i want to unlock the the door inside the garage, if the garage door hasnt opened within 45 seconds, unlock the front door.

Theoretically its possible that the garage door could be opened, someone could pull in, and then close it within 45 seconds which is why I just need to know if the garage door was opened within the last 45 seconds.

Is the best bet to try and use the get history node and feed the payload to a switch? Or maybe theres an easier way to do this and im over complicating it?

Wait until node.
Set the timeout to 45 seconds and set the property to state of the garage.

That is probably the easiest way to do it.