Restart run_duration fo deep_sleep

Hello everybody,
i would like to restart the running duration of the esp32 which is defined in deep sleep.
When one trigger is getting activated e.g. a GPIO connected motion sensor, i want that the esp32 restarts the timer till it goes into deep_sleep.

Here the example code:

  - platform: gpio  #Pin for Motion Sensor
    id: GPIO26
    pin: 26
    name: "Motion Sensor"
    device_class: motion
    - delayed_off: 30s
        condition: #conditions when motion Sensor is activated to switch LCD backlight on
          binary_sensor.is_on: GPIO26
          - light.turn_on: back_light
   >>>>> - restart deep_sleep timer <<<<<
          - delay: 60s
          - light.turn_off: back_light
          light.turn_off: back_light

  run_duration: 5min
  wakeup_pin: 26

Now the esp32 goes indepentendly of the triggering after 5 minutes into deep_sleep. But i would like that it goes only into deep sleep when there was no triggering in the last X minutes.

Maybe this is somwhere already solved or documented and i was blind. It would be nice to give me than a link.
Thank you very much in advance!