SELECT 
  DISTINCT warehouse_id 
FROM 
  cscart_store_locations AS sl 
  INNER JOIN cscart_warehouses_products_amount AS wpa ON wpa.warehouse_id = sl.store_location_id 
WHERE 
  wpa.product_id IN (123)

Query time 0.00031

JSON explain

{
  "query_block": {
    "select_id": 1,
    "message": "no matching row in const table"
  }
}