If a member of a retirement system established by the county for officers or employees of a county or judicial district, or for any portion of them, separates from the service of the county before retirement and the separation is for any cause other than permanent disability, there shall be paid to him, or in case of his death to his legal representative, all the money paid in by him as his contribution toward retirement under the system and accumulated interest thereon.