Nano 33 BLE system wake by (dual?) interrupt

Hi all

I'm making a PIR sensor device, powered by an energy harvesting circuit. I'm powering the Nano with 3v3 (necessary mods made) and wrote some basic code to bring it to deep sleep in between detections.

Purpose: when the PIR sensor detects movement, it wakes the Nano. Nano does some things, and goes back to sleep.

The problem I'm having is that I would like 2 conditions to be met for the Nano to wake up: A signal from the PIR sensor + some time since the last wake to have past (e.g. 5 minutes). This way, the Nano won't be woken constantly when someone is in the room, but (hopefully) only one time when the person enters. Is this possible and if so, how? See current code below. Thanks!

//PIR's digital output connected to pin P0.5 = A1
byte PIRsignal = 5;

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
  pinMode(PIRsignal, INPUT);
  pinMode(PIN_ENABLE_SENSORS_3V3, OUTPUT);
  pinMode(PIN_ENABLE_I2C_PULLUP, OUTPUT);

  digitalWrite(LED_PWR, LOW); // turn off power LED
  digitalWrite(PIN_ENABLE_SENSORS_3V3, LOW); // turn off I²C pullup
  digitalWrite(PIN_ENABLE_I2C_PULLUP, LOW); // turn sensor OFF
}

void Sleep() {
  //Wake when pin P0.05 = high
  nrf_gpio_cfg_sense_input(PIRsignal, NRF_GPIO_PIN_PULLDOWN, NRF_GPIO_PIN_SENSE_HIGH);
  NRF_POWER->SYSTEMOFF = 1;
}

void loop() {
  //Test code to visualize the Nano waking
  for (byte x = 0; x < 3; x++) {
    delay(950);
    digitalWrite(LED_BUILTIN, HIGH);
    delay(50);
    digitalWrite(LED_BUILTIN, LOW);
  }
  //Put the Nano in deepsleep
  Sleep();
}

I think such logic can be implemented only programmatically. Let the interrupt from the PIR wake up the board, the program first of all looks at how much time has passed, and if less than 5 minutes, it does nothing and falls asleep again

That's a straight forward solution indeed, but the problem is that even waking very briefly to check the passed time consumes too much energy. My harvesting circuits charges a supercap, and I only want to use its charge to detect and transmit as short and rarely as possible.

Also, I'm not a 100% sure of this (will test) but I think the way I'm powering down the Nano (NRF_POWER->SYSTEMOFF = 1;) , it causes a reset so any ram data or running timers will be reset when waking.