Before I provide suggestions, I will say that one of my least favorite direction given to musicians is "practice your scales". It's not that I don't think they're worth learning, but rather that it doesn't explain how to get the scales to be fluid and usable in a musical setting. I played them ascending and descending, and tried to "memorize" them, but they never seemed to stick. I thought it was just me, although I did do well in other subjects.
Now I realize that playing ascending and descending scales in all keys is not the answer to the question of how to know them in a fluid and usable manner. And it's not me.
There's a saying when you know something well, you "know it backward and forwards, and inside out". That's actually not a bad way to think about learning scales and keys. Practice them mindfully, in many different ways rather than just playing the same thing over and over. Each time you do them a different way, you have to pause and think about what you're doing. This is so much better than the mindful repetition that many of us have tried, but found to be not very helpful.
There are many ways to add variety
Practice scales with different fingerings. For a major scale, start with the first finger, then start with the second finger, then start with the fourth finger.
For multiple octave scales, practice different locations for shifts.
Start ascending, then descending one day. Start descending then ascending the next day. Play a different fingering ascending and descending.
Play all the notes of a given key in every position on the keyboard (e.g. go up the E string, then up the A string, then up the D string, then up the G string. Then do descending, for each string, or alternate ascending/descending on different strings, etc).
Play them while saying the note names. (can be done with any of the above)
Play them while singing the note names. (can be done with any of the above)
Play them while saying the scale degree. (can be done with any of the above)
Play them by singing the scale degree. (can be done with any of the above)
Play them by different intervals (e.g. thirds- play 1-3-2-4-3-5-4-6-5-7-6-8, then do 4ths, 5ths, etc.)
Play the triads, starting with each scale degree. Name the notes, name the triad, and the intervals (e.g. Major third plus perfect fifth equals major triad, AND major third, then another minor third makes major triad). Like above, vary ascending/descending
Play the 7th chords.
Don't start by doing everything all at once. Try the first set of variations (fingerings), then as they start to feel familiar (you stop thinking about what you're doing), then add a variation. The variations will make you focus, and that's what you want. They will slow you down, and make you think. This is what you want. If you practice mindfully and regularly, fluidity will come.
You need to do something with them every day, or nearly every day. Practicing regularly is more important than spending a lot of time in a single session.
You can also do mental practice when you're away from your instrument, like waiting in line or when you are about to go to sleep.