Update with joining another table
MySQL's syntax for UPDATE does not have FROM (you probably got the syntax from a SQL Server example).

The syntax in MySQL is:

UPDATE 
     &lt;table_references&gt;   -- this can be multiple tables joined 
                         -- with the JOIN .. ON syntax
SET 
     column_name_1 = value1,
     column_name_2 = value2
WHERE 
     &lt;conditions&gt;
... ;


Try this:

UPDATE
        cities_extended
    INNER JOIN
        cities
    ON
        cities_extended.state_id = cities.state_id
    AND
        cities_extended.city = cities.city
SET
    cities_extended.city_id = cities.id ;


or with table aliases:

UPDATE
        cities_extended AS ce
    INNER JOIN
        cities AS c
    ON
        ce.state_id = c.state_id
    AND
        ce.city = c.city
SET
    ce.city_id = c.id ;