I was trying to fix this lock but its not working, out of four one was intact and it locks right away, I am looking for new locks or to fix old locks.
Those fasteners are called cam locks or cam bolts. Here are photos of a cam lock nut and a cam lock bolt (or screw, or stud).
Your photo shows quite a large gap, especially at the lower left. Cam lock fasteners are not intended to draw a joint closed; they really should only hold it snug after the pieces have been fully pressed together. Try rotating the nuts to their open position, then press the pieces together to eliminate the gap, and finally rotate the cam to lock things together.
Finding the "open position," meaning that part of the nut where there's open space before the fingers engage, can be a bit of a trick. If you can disassemble the parts then you can look down inside to check its position. Sometimes the lock nut can be wiggled out of the wood and re-inserted at the right angle. If you have help, you may be able to have one person press the pieces together somewhat lightly while the other rotates the lock nut. Once it is into the open position the wood parts should move together.
It is possible that your cam lock nut and/or bolt is broken. Full disassembly is probably required to check for this, and definitely required if repairs are needed.