Superconductivity and magnetism in quaternary borocarbides