Sending digital sensor ouput over cable upto 30meters
If those are the only connections between them, and the grounds are not connected elsewhere, then what you have should be ok assuming the wires are heavy enough not to produce a significant voltage drop at that distance. I think I would use a MOSFET and not a transistor though.

However, I would remove the pull-up circuit that contains R2 and simple make it an open-collector output. The target expects only a pull down to it's reference ground. The pull-up will only complicate things and reduce the current drawn from the line.

Since it is talking about milliamps in the circuit loop, mains interference should not be a significant issue. Storm discharges though are something else. Use of transorbs may be warranted, or even a small isolation relay.

If the grounds at both ends are connected to different line-grounds, I'd definitely isolate, either with a relay or a suitably protected opto-coupler.