update B b set b.value=(select max(a.value) from A a where b.key=a.key) where exists(select 1 from A c where b.key=c.key)
UPDATE A a,(select a.`key`,b.`value` from A INNER JOIN B on a.`key`=b.`key`) b SET a.`value` = b.`value` WHERE a.`key` = b.`key`