Hi,
to mimick a hinge joint, you would need to set the config joint as:
XMotion, YMotion, ZMotion all on ‘Locked’
angularXMotion, angularYMotion, angularZMotion all set to ‘Free’
set angularXDrive mode to ‘position’
set angularXDrive spring to ‘20’ or whatever.
set angularYZDrive mode to ‘position’
set angularYZDrive spring to ‘20’ or whatever.
then set the ‘Target Rotation’ to be what you want.
If you want an ‘angle’, like 90 deg, then you can use:
somejoint.targetRotation = Quaternion.Euler(new Vector3(0,90,0));
All this is relative remember, so if you have the object in the position you want already, then leave rotation to 0 then it should just act like a springy thing in all axis (from the pivot point of course)
The above is more like a springy ball socket joint actually. If you want a true hinge, just ‘Lock’ the appropriate angular?Motion things you want frozen (e.g a hinge on X you would lock Y and Z angular motion). or just leave 0 in the vectors when setting the Target Rotation.
You could then ‘lock the joint at certain times’ by setting the target position (make sure the spring is set high enough). Add damping on it too to stop it going bananas when it goes to its target if the spring is high.
This way, all physics will behave happily.
This is presuming you are adding the components through the editor, not with scripting.
(…or are you wanting to do it all through script?)
Hope it helps / hope its correct - sorry if it’s not - going from memory. 
Dave