The Spanish one is primarily from Spain. You hardly hear it used in latin America, but it is still well understood. How the venerable cucumber became synonymous with “worthless”, I do not know.

My Spanish speaking friends and family use “…no me importa un carajo” which is close to “…do not care a fuck”, which is the same vibe as “don’t give a fuck”. The word “carajo” is very flexible, like fuck, as is “cabrón” which technically means cuck but is often used in many ways both negative and positive, depending on context.

We say “Me valen tres hectáreas de verga” in Mexico

It’s worth three acres of dick