Isolated mains (AC) presence detector
Simply use something like HCPL3700, which is basically your circuit in one package. You only need one input resistor and bypass cap to make it work.

Note, that either your circuit or HCPL3700-based one are not actually "isolated", but rather "optocoupled", because you still have to connect wires to mains somehow, so full voltage is present at least on part of the board.

Truly isolated circuit would be something like Non-contact voltage (NCV) sensor found in some multimeters. For example circuit like this or this can be used without ever coming in contact with mains.