China’s exports and imports expanded at a faster pace in May, topping forecasts as booming demand for artificial intelligence hardware offsets disruptions from the war in Iran.