40K is just a soft limit. You can contact support to increase the limit to any number you like.
In OnDemand mode tables have practically no limits on throughput or storage (just like provisioned mode).
Disclaimer: I work for DynamoDB but comment is my own.