I one time had problems like you have now - and I still have them a lot!
I think jeffstocksmusic is right. If you really want to play a tune fast,
first play it slowly- start at level zero!
Start at a tempo you're playing the tune, the scale the riff, what ever you're playing perfectly. Then go up 5 BPM and do the same again. If you're able to play the riff perfectly in that tempo, then go up another 5 BPM.
Do that till you can't go up anymore without loosing the perfection.
The next day you first revise the riff in the tempo you stopped yesterday. If you can't play start from the beginning again.
The important thing is that you know the riff/scale by heart. You're fingers have to be like a machine, and it's best if you don't even have to look at you're fingers while playing.
There might be a day when you think" Man I think I'm getting worse" but keep on playing the riff perfectly and increasing another five beats, perhaps even if you need days for it. Don't forget to start everyday from level zero and go up to the tempo of yesterday before you go on with a new (faster) tempo. Another hint: Try to play it effortlessly and smooth-stay calm while playing it without a cramp in your fingers

, and one last one : PATIENCE!
I hope I could help you!
Blue(s) Skies