if statment to compare a interval

This is a part of the the code that will check if the internet is OK on a remote device.

The code will run every 300 sec.
With other words I want a reaction when the two Epocs are more than 300 + 60 sec apart, positive or negative...
It seams to work after many hours of headache.. But is there any better way to perform it?
The time can differ 300 sec since that is the worst case scenario (but still ok) when bouncing the values via Firebase every 5 min. The 60 sec is just extra margin.

// timeNHR is an "int" containing the Epoch-time
// remoteTime is an "int" containg the Epoch-time received via Firebase
// timeBetweenAlivePolls is an "int" containing 300 (But may vary)


      if (timeNHR - remoteTimeNHR >= timeBetweenAlivePolls + (60) && timeBetweenAlivePolls - (60)) {

    Serial.println("Bad remote internet");
    remoteInternetBad = true;
  }
    else {
      Serial.println("Good remote internet");
      remoteInternetBad = false;

  }
&& timeBetweenAlivePolls - (60))

this evaluates to false only when timeBetweenAlivePolls==60; all other time it will be true.

jagakatt:
With other words I want a reaction when the two Epocs are more than 300 + 60 sec apart, positive or negative.

I think the logic needs to be like this pseudo code

timeDiff = abs(timeNHR - remoteTimeNHR);
if (timeDiff > 360 or timeDiff < 240) {

…R

Just realized the the remote time, from the remote (dead) device to be checked, can never be more then on the checking device.
The only outcome is an "old" time stamp in Firebase if the remote device is disconnected.

And thanks for the suggestions, it might come handy further on!

Looks like this does the job!

   if (timeNHR - remoteTimeNHR >= timeBetweenAlivePolls + (60)) {

jagakatt:
Looks like this does the job!

   if (timeNHR - remoteTimeNHR >= timeBetweenAlivePolls + (60)) {

There is no need for () around the 60

...R