My character is a Ranger with the spell Zephyr Strike, which increases my speed by 30ft after I make an attack. If I have already used all my movement to reach an enemy, can I attack and then use the increased 30ft to move away?
The movement in combat rules say that:
"You can break up your movement on your turn, using some of your speed before and after your action."
Your overall speed is increased by 30ft after the attack for the rest of this turn only. So if your normal speed is 30ft, your total speed for this turn is then 60ft. You've already moved 30ft of it before the attack, so you have 30ft left to use as much of as you like after making the attack.
Even better, Zephyr Strike grants that:
your movement doesn't provoke opportunity attacks
So the enemy you just hit can't make an opportunity attack against you if you use your new extra movement to escape their threatened area.
Zephyr Strike is an unusual spell because it includes a variety of things it does and those things are contingent upon whether the spell is active or not.
First of all, let's address the root of your questions about moving away. You may do so because the spell specifically states:
Once before the spell ends, you can give yourself advantage on one weapon attack roll on your turn. That attack deals an extra 1d8 force damage on a hit. Whether you hit or miss, your walking speed increases by 30 feet until the end of that turn.
This means your walking speed is increased by 30 feet until the end of your turn. Curiously, you can stop concentrating on the spell at this point and this clause would still be in effect. The only criteria for the increase in walking speed is that you attempted a weapon attack roll on your turn before the spell ends.
I believe there's a second implied question relating to this regarding whether you can move away from the enemy without provoking an opportunity attack. And the answer to that is entirely dependent on whether you maintain concentration.
The spell includes this clause:
Until the spell ends, your movement doesn’t provoke opportunity attacks.
If you make your attack as described and stop concentrating on the spell then you would have the extra movement, but provoke the opportunity attack. However, if you were to maintain concentration following your attack then you could use the additional movement to escape without the enemy getting a chance to hit you back.