Millis() Not Delay's

Hello Everyone,
I'm using two PIR and Two relay for stair-light automation. I don't want to use delay as it pauses the Arduino and i want my PIRs to work parallel, which could be not possible due to delays also not from the PIR delay.
I'm still new to use millis. Please anyone can help to increase the on time for relays

MY CODE:-

const int MOTION_PIN1 = 3;
const int RELAY1 = 9;
const int MOTION_PIN2 =5;
const int RELAY2 = 10;

void setup()
{
Serial.begin(9600);
pinMode(MOTION_PIN1, INPUT_PULLUP);
pinMode(RELAY1, OUTPUT);
pinMode(MOTION_PIN2, INPUT_PULLUP);
pinMode(RELAY2, OUTPUT);

}

void loop()
{
int proximity1 = digitalRead(MOTION_PIN1);
int proximity2 = digitalRead(MOTION_PIN2);

if (proximity1 == HIGH && proximity2 == LOW)
{
digitalWrite(RELAY1, HIGH);
digitalWrite(RELAY2, LOW);
Serial.println("Relay 1 Is On");
}
if (proximity1 == LOW && proximity2 == HIGH)
{
digitalWrite(RELAY2, HIGH);

 digitalWrite(RELAY1, LOW);
 Serial.println("Relay 2 Is On");

}
if (proximity1 == LOW && proximity2 == LOW)
{

digitalWrite(RELAY2, LOW); digitalWrite(RELAY1, LOW);

//Serial.println("NO Relay Is On");

}

//if (proximity1 == HIGH && proximity2 == HIGH)
//{
//digitalWrite(RELAY1, HIGH); digitalWrite(RELAY2, HIGH);

//Serial.println("Both Relays Are On");

}

}

does this help?

#undef MyHW
#ifdef MyHW
enum { Off = HIGH, On = LOW };

const int MOTION_PIN1 = A1;
const int RELAY1      = 10;
const int MOTION_PIN2 = A2;
const int RELAY2      = 11;

#else
enum { Off = LOW, On = HIGH };

const int MOTION_PIN1 = 3;
const int RELAY1 = 9;
const int MOTION_PIN2 =5;
const int RELAY2 = 10;
#endif

#define TimeOn  5000

unsigned long msecRly1;
unsigned long msecRly2;

void setup()
{
    Serial.begin(9600);
    pinMode(MOTION_PIN1, INPUT_PULLUP);
    pinMode(RELAY1, OUTPUT);
    pinMode(MOTION_PIN2, INPUT_PULLUP);
    pinMode(RELAY2, OUTPUT);

    digitalWrite(RELAY1, Off);
    digitalWrite(RELAY2, Off);
}

void loop()
{
    unsigned long msec = millis ();

    int proximity1 = digitalRead(MOTION_PIN1);
    int proximity2 = digitalRead(MOTION_PIN2);

    if (On == digitalRead (RELAY1))  {
        if ((msec - msecRly1) > TimeOn)
            digitalWrite(RELAY1, Off);
    }
    else  {
        if (proximity1 == On && proximity2 == Off)
        {
            digitalWrite(RELAY1, On);
            digitalWrite(RELAY2, Off);
            Serial.println("Relay 1 Is On");

            msecRly1 = msec;
        }
    }

    if (On == digitalRead (RELAY2))  {
        if ( (msec - msecRly2) > TimeOn)
            digitalWrite(RELAY2, Off);
    }
    else {
        if (proximity1 == Off && proximity2 == On)
        {
            digitalWrite(RELAY2, On);
            digitalWrite(RELAY1, Off);
            Serial.println("Relay 2 Is On");

            msecRly2 = msec;
        }
    }
}

Relay 1 is always on
i want my relays to on for 30 sec if sensor senses but its not happening

what is the state of the proximity sensor?

change the "OnTime" from 5000 to 30000

here was a issue with wire.
but there is another need, i need my relays to be on parallel, so if one sensor sense and then next senses too, i want my relays to on for both at a same time, but its not happening with this code
can you please make some changes, as im not able to do that

OK, I finally solved the last problem, so Thank you So much for your suppourt