Can I paint part of a wall in a seamless way a couple years after?
If you have any of the paint left from before, just use that. There may be some very slight differences, but they likely won't be noticeable on such a small area. 

If you don't have any leftover paint, you can take a small sample from the current wall and have a paint store match it. Matching is very accurate and will produce results that are indistinguishable from the rest of the wall. The downside is this may be the most expensive, as some stores won't sell a matched color in any of their product lines, nor in any size. I just had this done at Sherwin Williams, and had to get a quart of Duration, for ~$25, to cover a square foot of wall. The color was perfect, but certainly not cheap. 

Or, if you know the color and sheen used, just get a small can of it. There's more likelihood of there being slight differences due to the different calibrations of the tinting machines, but those should be very slight. 

On all cases, feather the new paint onto the old painted surface. Your area is so small, though, that you provably doubt need to feather much.