A chandra snapshot survey for 3C radio galaxies with redshifts between 0.3 and 0.5