Yes, you can purchase it in advance.
The QR code will be sent to your email immediately after purchase, and you can install it whenever convenient.
However, data usage starts only after you connect to the LG U+ network in Korea, so the validity period will not be used before your trip.