Compound Index vs Single Index with all compound fields

Hey everyone,
I have the scenario that I have a slow query that I am triing to optimize, where I have a unique compound index that is used for the query.

Imagine the following datamodel

locationId: String
date: LocalDate
customerId: String
version: Integer
timestamp: Instant

and a compound index on locationId,date and customerId(with unique=true)

I am right having trouble with a slow findAndModifyQuery that goes kind of like

mongoTemplate.findAndModify(  
   Query.query(  
       Criteria()  
           .andOperator(  
   			where("locationId").isEqualTo(locationId),  
   			where("date").isEqualTo("date"),  
   			where("customerId").isEqualTo(customerId),  
   			Criteria().orOperator(  
   				Criteria.where("version").lt(version),  
   				Criteria().andOperator(  
   					Criteria.where("version",).isEqualTo(version),  
   					Criteria.where("timestamp").lt(timestamp),  
   				),  
   			),  
   		  ),  
   	  )
   	  //update operations ..

The query is triing to:
Find the entity with the three identifying factors (which is unique) and if it exists check its version & timestamp.
If the version is really old always update it, otherwise check the timestamp and if is older update the entity.

This query is really slow on my system, taking over up to 30 seconds on a 7 Million entity database and I am triing to optimize it.

What is a good approach here?
Does it help to merge locationId,date and customerId into a single field (like "$locationId-$date-$customerId" and make it a single field index?

That would also allow me to use the combination of those three fields as id, and therefore completely drop the custom index and use the _id index, but I am not sure if it is worth the effort, since migrating the data is a lot of effort.

Thank you a lot!

Hi Patrick,
It would be really helpful if you share the output of explain so that we can see what part of the query is taking that much long to execute or even if the index is being used or not.