Backing up huge iCloud photo library to external HDD
I think you have two options here:

Download the images and save them to your external hard drive
Create a photo library on the external drive and use that one with iCloud enabled (however iCloud is not a backup service, only a syncing service, so you'd then also want to backup that drive)


For the first option there are multiple online guides:

iCloud to Mac
iCloud to PC
iCloud to iPhone

I assume you are one a Mac. You should be able to simply hit cmd + a and be able to download all of the images. If not select an image, then scroll down as far as you want, hit shift and select the last image.
There is a download limit of 999 images in iCloud.com, so you'd need to select a certain range of images with shift. This will - for 30000 images - take quite some time but is technically possible.

I would however encourage you to pursue option two for multiple reasons. What you'd want to do:

get another external hard drive with at least the size of both your current external drive and the MacBooks internal drive combined
Create a new photos library on your MacBook, store it on the current external drive
Enable iCloud on that photos library (go into the photos app settings with this library opened and open the iCloud preference pane). After some wait time, you should have all the images synced across your iCloud devices, including the photos library stored on your external drive
Connect your newer and bigger hard drive as well and enable Time Machine in your mac settings including a backup of your external drive. That way you ensure you have both your Mac and your photos on the external drive backed up with history.
If you don't want a TM backup you could also open the library package (right click on the .photoslibrary file and the show package contents) and copy the images to somewhere else. All images excluding deleted ones are in the Master and originals folder inside the library package.

This article may also help you: https://support.apple.com/en-us/HT204264
Some advantages of option two:

both your Mac and the external drive are backed up
You can work with the photos app offline and don't need to use the web interface on your Mac
You get a backup history of your photoslibrary and mac files
If iCloud at some point fails, you can get the actual library back (including albums, face recognition data,...) and not only the raw images

I know that you would need to buy a second drive to achieve this, yet even multiple TBs of storage capacity these days often costs less than 100€. I just recently had to restore my photoslibrary due to some bug I suspect in macOS BigSur and - trust me - it is not worth it taking that risk.

Note: For option two you could theoretically also partition the one disk you have and use the second partition as backup partition, yet a phyiscal failure of that drive will mean you lose the data on the external drive, but not the data in iCloud, which includes the photos.