Here's a solution involving traversable wormholes, which Ash already mentioned as a possibility, but I'll give a little more detail to show how it can be done without violating causality (no one can do anything to exert a causal influence on their own past self).
One key thing to understand about traversable wormholes is that time hooks up differently through the wormhole than the time measured by external observers (as discussed for example on p. 501-502 of the book Black Holes and Time Warps by Kip Thorne, the physicist who discovered that traversable wormholes were theoretically allowed in Einstein's theory of general relativity, and explored how they would behave according to the theory). Suppose we have two wormhole mouths that are initially at rest relative to each other, and clocks are placed next to each mouth, and synchronized by sending signals through the wormhole. So, assuming the trip through the wormhole is quasi-instantaneous, if you pass by one clock reading 9:00 AM, Jan 1, 2100 as you enter one mouth, then as you exit the other mouth you'll see the clock there also reading 9:00 AM, Jan 1, 2100. Now suppose one of the mouths is accelerated to a significant fraction of the speed of light relative to the other mouth. Assuming an asymptotically flat spacetime (no significant spacetime curvature except for wormholes themsleves), an external observer who is at rest relative to one mouth is going to see the clock next to the moving mouth tick significantly slower than the clock next to the mouth they see as being at rest, due to velocity-based time dilation. So from their perspective, the clocks are going to get increasingly out-of-sync. However, anyone traveling through the wormhole will see the clocks remain in sync, because of the way time threads through the wormhole according to general relativity. So, if someone dives into one mouth when the clock next to it reads 3:15 PM, Jan. 17, 2100, they'll exit the other mouth when the clock next to that one reads 3:15 PM, Jan. 17, 2100, even if this implies the external observer will measure them to enter and exit at very different times, or even measure them exit one mouth earlier than they entered the other.
Suppose there is a planet, call it Planet X, which is 1000 light years away from Earth, and at rest in the Earth's frame. And suppose we have a wormhole connecting the two, with one mouth initially at rest near each planet, and clocks next to each mouth are initially seen as synchronized in the reference frame where both are at rest. When the clock on the one near Earth reads 9:00 AM, Jan 1, 2100, twin B jumps through the wormhole while twin A remains on Earth, so twin B exits the other mouth near Planet X on 9:00 AM, Jan 1, 2100, both according to the clock next to that mouth and according to the coordinate time in the Earth/Planet X rest frame.
Now suppose that while twin B remains living on Planet X for many years, the wormhole mouth that was formerly at rest near Planet X is accelerated to a large fraction of light speed in Planet X's rest frame, travels away from Planet X for some time, then is accelerated to turn around and travel back towards Planet X at a large fraction of light speed, and finally accelerated a third time to come to rest again near Planet X. In this case, if twin B compares the time elapsed on his own clock to the time elapsed on the clock that traveled along with the wormhole mouth, he will find his clock shows more time has elapsed than the clock that took the trip--this is the standard twin paradox scenario. For example if the wormhole mouth had a speed of about 0.994987437 times the speed of light in Planet X's frame for nearly all of its trip, then twin B should measure the mouth's clock to have elapsed only about 0.1 the amount elapsed on his own clock. Say twin B exited the mouth near Planet X at 9:00 AM, Jan 1, 2100, and very shortly after that they saw the wormhole mouth begin its journey, accelerating to 0.994987437c at 11:15 AM, Jan. 1, 2100. Twin B remained on Planet X for the next 60 years, and then at 11:15 AM, Jan. 1, 2160 according to their own clock, they saw the wormhole mouth return from its journey. But because of the velocity-based time dilation effect, the clock that had traveled along with the wormhole mouth only showed an elapsed time of 6 years rather than 60, so its time would be 11:15 AM, Jan. 1, 2106.
But because of time threading differently through the wormhole than outside it, this means that if twin B now hops through the wormhole mouth to return to Earth, they will exit the mouth near Earth when its clock also reads 11:15 AM, Jan. 1, 2106. But since that wormhole mouth has just remained at rest near Earth, not taking any high-speed journeys, it has remained in sync with the personal clock of twin A on Earth. So twin A on Earth has really only experienced 6 years between the moment twin B first hopped through the wormhole to depart for planet X, and the moment twin B emerged back from the mouth. But twin B experienced 60 years between those wormhole journeys, so he's really 60 years older, i.e. he has aged 54 more years than twin A.
In the coordinate system where Earth and Planet X are both at rest, it's true that the event of twin B emerging from the wormhole mouth back on Earth happens at an earlier time-coordinate than the event of twin B traveling into the wormhole mouth at Planet X. However, this is not a true causality violation because a light signal sent from the first event won't be able to reach the second event, since the second event happens 54 years after the first one in this frame, but I said earlier that Earth and Planet X are 1000 light-years apart so it'll take 1000 years for a signal to travel from one to the other through normal space. So this type of story could be consistent with the chronology protection conjecture which supposes that although it might be possible for such time differences to accumulate between separated wormhole mouths, if you try to move them close enough to allow for causality violations (say, slowly moving the two mouths in this example towards each other until they get to be 54 light-years apart while retaining the time difference of 54 years in their rest frame), quantum effects will build up and destroy the wormhole. I talked more about what the assumption of wormhole travel + the chronology protection conjecture might imply for a science fiction universe in this answer.