does the lock work with the door in the open position,try throwing the handle up and locking when the doors open,if its ok then the strikers/door need some adjustment,if not then it could be the cylinder or the whole mech.
remove the cylinder,look for a screw on the open edge of the door at the same height as the cylinder,remove this completely and the barrel will be a bit loose,you need to turn the key either slightly left or right whilst pushing the cylinder from the other side,it should slide out,loosen the handles can make it easier.
take the barrel to a local locksmith who can advise you if it works ok,if not a new cylinder might be your answer,if ok then the whole mech needs to come off,usually removeing all the screws down the open edge and remove the handles and the mech will pop out the door.again,a local locksmith should be able to help,id ring round 1st though to see who stocks them,expect to pay from £65 upwards and £10 upwards for a cylinder