timer using millis()

Program-1

const int Pin = 4 ;
int pin4State= LOW ;
int pin3State= HIGH;
unsigned long previousMillis=0 ;
unsigned long interval= 10000;
void setup(){
pinMode(4,OUTPUT);
}
void loop(){
unsigned long currentMillis = millis();
if( (currentMillis-previousMillis>interval)){
previousMillis=currentMillis;
if(pin4State=LOW);
pin4State=HIGH;
digitalWrite(4,pin4State);
}
}

Program-2

const int Pin = 4 ;
int pin4State= LOW ;
unsigned long previousMillis=0 ;
unsigned long interval= 10000;
void setup(){
pinMode(3,INPUT);
pinMode(4,OUTPUT);
}
void loop(){
unsigned long currentMillis = millis();
digitalRead(3);
if( (currentMillis-previousMillis>interval)){
previousMillis=currentMillis;
if(digitalRead(3)==HIGH){
pin4State=HIGH;
}
else{
pin4State=LOW;
}
digitalWrite(4,pin4State);
}
}

I have written codes for 2 programs as above. In prog-1 pin 4 changes state after
10 sec. But in prog-2 I want pin 4 state to change as per condition of pin 3. If pin
remains HIGH even after 10 sec pin 4 should go HIGH. If pin 3 goes LOW before 10
sec then pin 4 should remain LOW. I have also noticed in prog-2 pin 3 all time drag to LOW. What is reason for that? What should be right code for prog-2?
N.N.Joglekar

const int Pin = 4 ;
int pin4State= LOW ;
int pin3State= HIGH;
unsigned long previousMillis=0 ;
unsigned long interval= 10000;
void setup(){
  pinMode(4,OUTPUT);
  }
void loop(){
  unsigned long currentMillis = millis();
 if( (currentMillis-previousMillis>interval)){
    previousMillis=currentMillis;
    if(pin4State=LOW);
    pin4State=HIGH;
    digitalWrite(4,pin4State);
  }
}

Program-2

const int Pin = 4 ;
int pin4State= LOW ;
unsigned long previousMillis=0 ;
unsigned long interval= 10000;
void setup(){
  pinMode(3,INPUT);
  pinMode(4,OUTPUT);
}
void loop(){
  unsigned long currentMillis = millis();
  digitalRead(3);
if( (currentMillis-previousMillis>interval)){
    previousMillis=currentMillis;
    if(digitalRead(3)==HIGH){
    pin4State=HIGH;
    }
    else{
      pin4State=LOW;
    }
    digitalWrite(4,pin4State);
  }
}