I had a similar problem with my drivers side door lock. The key would lock the door but would not open it. I removed the door handle and lubricated and turned the mechanism with the key when the door handle was removed. After I put it back the situation reversed, the door would open but not lock. I was told by the dealer to change the handle for a cost of somewhere around $400. I did not fix the problem but lived with it for months. Recently I had to replace the window regulator on the door and i did this job. After that my door lock works perfect. I was surprised and dont know what fixed it but saved me from changing the handle.
I would suggest as a first to remove the door handle and take a look at it and try to move the key both ways with lubrication. Give it a try.