[SOLVED] Two switched for one output.

In a nut shell I have a mains plug connected to a mega via a relay board on pin D40.

I have a float switch connected to D51 using internal pullup.

I also have Blynk app with a push button which will write the variable pwrbut1 as 1 when pushed and 0 when pushed again.

The plan....
I need both switches to work independently but yet not interfere which each other. I need to be able to turn the plug socket on and off through the Blynk button, allow the float switch to turn the plug on and off on its own when water gets too high, but neither should be able to switch it on if the other is switching it off.

Hope that makes sense. Is this possible? I haven't started writing script for it yet as just in the theory stages and can't see how I can get it to work.

Actually may have been simpler than I thought...

int sensorVal = digitalRead(51);

  if ((sensorVal == HIGH) && (pwrbut1 == HIGH))
  {
    pwr1on();
  } 
  else 
  {
    pwr1off();
  }

Going to give this a go.

EDIT...
All works. Sorry for the waste of a thread.