Scalar field dark matter with spontaneous symmetry breaking and the 3.5 keV line