I would be more worried about why the warning popped up rather than just turn it off and forget about it. It could be telling you something you should know. I would start by being sure that sensor is clean (this is mentioned in the owners manual).
But I don't think there's a single setting for each sensor, at least not one for the above sensor only. It's either all on or all off, or the modes that turn off side-sensors.
I don't think you can, I have had forward & rear off and then switched downwards looking off but couldn't find a switch for upwards looking.
As Chris has suggested remembering to switch them on again after the flight that needed them off is a VERY GOOD idea.
Have tried to turn off everything that goes, the warning comes anyway.
Have looked in FlightRecord backwards and find that the warning has been there all along,
If you fly about 1m under a tree branch, the warning comes, but the drone does not stop, however if you ascend it will be a sharp stop, really very good it is just that you get used to how the drone reacts under different circumstances.
In the house is keeps a M2 whatever clear of the ceiling, it's a bit of a curse in that situation as it very much constrains the flight to a fairly narrow layer 'well away' from both the floor and ceiling.
Indcidentally I have forced either an M2P or an M2Z to land by lowering my hand when my hand was over the upward looking sensors. The motors didn't seem to stop once it had landed but it did not take off again.
That said it brings to mind a recollection of a lost Mavic where the pilot had possibly got caught out by wind and made a safe emergency landing at some remote place. For whatever reason he didn't or couldn't shut the motors down and, possibly at a loss of signal, it attempted a ( fail safe? ) RTH and was lost when the battery died. It landed in bushes and couldn't be found.
The lesson be shut the motors down after landing if they don't do so automatically