Are you looking for a complete MCU where you just have to wire the matrix to the controller, then connect the controller via USB to your PC?
Teensy no longer makes the Teensy ++ 2.0 anymore, but that is what I used in the past with good luck. Lots of pins and known to work well with keyboards. You can find China copies and old stock if you google it.
Otherwise, a PGA2040 is the smallest full pinout RP2040 board that has all 30 pins broken out, but would be harder to use than say an RP2040 Stamp which has built in reset pins for flashing. Neither have USB out via an integrated USB port. Both above are considered "MCU Modules" which means they contain all the parts/pins, but lack an on board USB port. Easy fix is to buy a USB cable, cut off an end and solder the wires to the module directly. Modules also are great if you want to make your own PCB since the USB port won't be on the MCU anyway.
As far as using QMK to do what you want, I am not sure. I haven't gotten that far in my own PCB journey and used another method to flash my handwired AEK a while back. I assume if QMK has support for a solenoid it would be similar to how they do status LEDs where you just indicate the pin used for the solenoid and the software does the rest.
The market for an MCU with 27+ pins (what is normally needed for a clean handwire build) is very small and as such, not a lot offered.