Copy data from one table into other on some condition
ALTER TABLE locality ADD COLUMN city_id ...;  -- add new column
UPDATE locality
  JOIN city  ON city.city_name = locality.city
   SET locality.city_id = city.city_id;  -- set new column
ALTER TABLE locality DROP COLUMN city;   -- cleanup by removing old column