SELECT 
  cscart_logs.*, 
  cscart_users.firstname, 
  cscart_users.lastname 
FROM 
  cscart_logs 
  LEFT JOIN cscart_users USING(user_id) 
WHERE 
  1 
  AND (
    cscart_logs.timestamp >= 1747700169 
    AND cscart_logs.timestamp <= 1747703769
  ) 
  AND cscart_logs.type = 'requests' 
  AND cscart_logs.action = 'shipping' 
  AND cscart_logs.company_id = 2 
ORDER BY 
  cscart_logs.timestamp desc, 
  cscart_logs.log_id desc

Query time 0.00043

JSON explain

{
  "query_block": {
    "select_id": 1,
    "read_sorted_file": {
      "filesort": {
        "sort_key": "cscart_logs.`timestamp` desc, cscart_logs.log_id desc",
        "table": {
          "table_name": "cscart_logs",
          "access_type": "ref",
          "possible_keys": ["type", "idx_timestamp"],
          "key": "type",
          "key_length": "100",
          "used_key_parts": ["type", "action"],
          "ref": ["const", "const"],
          "rows": 1,
          "filtered": 0.870333016,
          "index_condition": "cscart_logs.`type` = 'requests' and cscart_logs.`action` = 'shipping'",
          "attached_condition": "cscart_logs.`type` <=> 'requests' and cscart_logs.`action` <=> 'shipping' and cscart_logs.company_id = 2 and cscart_logs.`timestamp` >= 1747700169 and cscart_logs.`timestamp` <= 1747703769"
        }
      }
    },
    "table": {
      "table_name": "cscart_users",
      "access_type": "eq_ref",
      "possible_keys": ["PRIMARY"],
      "key": "PRIMARY",
      "key_length": "3",
      "used_key_parts": ["user_id"],
      "ref": ["cscart_purchase_fl_com.cscart_logs.user_id"],
      "rows": 1,
      "filtered": 100
    }
  }
}