Real estate investment trust American Assets Trust Inc. agreed to buy the two-tower La Jolla Commons office complex in San Diego’s University Town Center neighborhood for $525 million, the city's second-largest commercial property sale in at least the past two decades.