Run Sprint animation and stop it when button is released

I have this script and it works perfectly, but when you release the left shift it still runs the animation

function Update () {

if  (Input.GetKey(KeyCode.LeftShift) && Input.GetKey(KeyCode.W))
animation.Play("ANIMATION_NAME");

}

Also, how can I get it to increase speed, too?

You are re-running the animation every frame. So when you release the key its still going to run for at least one cycle.
If it is doing more then that, is it possible you have the animation set to loop?

As for increasing speed, the best way is to have a walk animation and a separate run animation at max speed and use animation blending for the points in-between.