RFID won't forget UID until a new card is scanned

I am working on my bachelor project, where i plan to use a RFID scanner and other sensors to control a street lamp.

I am studying product development and a major part of that is fabrication prototypes as proof of concept, which means i have a lot of introductional courses in rapid prototyping without any deeper knowledge. They call it a self study. It project driven, and they expect us to pick up the relevant knowledge on our own.

So the only programming knowledge i have, comes from the time i played around the PHP back in the early 2000 and what i have played around with arduino the last year.

My plan is to make i sketch, that will check the status of each sensor and set a variable, which i use later to determine which state the lamp should be in.
I have verified that my project is duable, and have made all of the sensors work independently or in combination, now I am trying to combine them all in my final prototype.

I found a simple sketch that will scan your RFID tag and output true or false in the serial monitor, it allows me to enter the UID in the sketch and turn on different LEDS depending on which card is scanned.

When I started to combine the sensor I noticed an issue with my RF522 or the code i found to work with.
The issue is once a card is scanned it won't forget the UID which is a major issue for me, since I basically need it to act as an on/off switch.

The reason I use RFID is because i need is to act as an override which will ignore all the other sensors.

so basically i need a:

if (RFID=="active"){
do this;
} else {
do the other stuff;

The guide I am working from is this once MFRC522 RFID Reader with Arduino Tutorial | Random Nerd Tutorials

I hope somebody can point me in the right direction to find a code which will output a true statement only the the scanner is actively scanning a auth tag and false when the card is removed again.

Post your code as it is now

 * All the resources for this project: https://randomnerdtutorials.com/
 * Modified by Rui Santos
 * Created by FILIPEFLOP
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
#define LED 4
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

char *timeperiode[] = {"No Scan", "Scan", "No access"}; 

const int buttonPin = 2;     // the number of the pushbutton pin
int buttonState = 0;
void setup() 
  Serial.begin(9600);   // Initiate a serial communication
  SPI.begin();      // Initiate  SPI bus
  mfrc522.PCD_Init();   // Initiate MFRC522
  Serial.println("Approximate your card to the reader...");
  pinMode(LED, OUTPUT);
  pinMode(buttonPin, INPUT);

void loop() 
  int RFID_status=0;
  int PIR_status=0;
 int sensorValue = analogRead(A7);
  buttonState = digitalRead(buttonPin);
  // print out the value you read:
  RFID_status = 0;
  if (buttonState == HIGH) {
  PIR_status = 1;
  } else {
  PIR_status = 0;
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent()) {
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial()) {
  //Show UID on serial monitor
  Serial.print("UID tag :");
  String content= "";
  byte letter;
  for (byte i = 0; i < mfrc522.uid.size; i++) 
     Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
     Serial.print(mfrc522.uid.uidByte[i], HEX);
     content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
     content.concat(String(mfrc522.uid.uidByte[i], HEX));
  Serial.print("Message : ");
  if (content.substring(1) == "6A 2A 80 96" or content.substring(1) == "01 19 65 A3") //change here the UID of the card/cards that you want to give access
  RFID_status = 1;
 else   {
  RFID_status = 2;

  Serial.print("RFID Status: ");
  Serial.print("RFID Status: ");
  Serial.print("PIR Status: ");
  // Look for new cards
  if ( ! mfrc522.PICC_IsNewCardPresent())
  // Select one of the cards
  if ( ! mfrc522.PICC_ReadCardSerial())

Why are you calling functions, testing what is returned then ignoring the result of the tests ?