Cylinder locks with electromagnetic control