Is there a way to update a column on one table with the primary key generated by an insert on a different table in one transaction?

The following code example *does not work*, but perhaps illustrates what I am trying to do in MySql:

```
UPDATE orders SET address_id = (INSERT INTO addresses() values())
WHERE order_id = 666

```

I'm trying to do this in the context of a jdbcTemplate update.