That's because the standard regular expressions are "greedy", i.e. they match the long possible pattern that matches the regex. If you use the perl-compatible module instead, you can ask it to be non-greedy. However, even if you do that, you may still have trouble with .* since it includes the starting pattern. That is, your current pattern, in text, asks to match:
'=X='
followed by zero or more characters of any type whatsoever
followed by 'second'
followed by zero or more characters of any type whatsoever
followed by '=xX='
Now, the non-greedy option with preg_match() will cause it match at the first '=xX=', so you won't get the "third" undesirable part, but I don't think it will cause the initial '=X=' to become un-anchored.
In short, splitting the string on '=xX=' (and then stripping off the leading =X= where present) will be a whole lot easier.