If you have tried with 500 minutes from back end and it's not working where you have millions of record.
I have tested my db is taking approximate 2 to 3 minutes for 11 thousand of records.
So it may take lots of time for millions of recode.
And you can consume less amount of data with for to select instead of whole the record. and you can try again in your commandtimeout length to increase
cmd.CommandTimeout=1800;