Sounds like you will run into file locks,
taking a layer out of an open ArcMap document and trying to overwrite its source.
I cannot imagine why one would need to do that.... However,
You could access the mxd file with python
(not open it in ArcMap),
grab the layer,
save it to memory (or another gdb),
close the mxd (delete the mxd object variable)
and then overwrite the fc in the gdb with the in memory fc.