UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/57OrWk2058CbFUR3vrlso4SPxssKg2I+OsPdDg4cPU=' 
WHERE 
  key_id = '91aa69602bc1cea01efbe621951ef9d2141a1e34324f7d91107c5b241f06b1a1' 
  AND (
    token = '/57OrWk2058CbFUR3vrlso4SPxssKg2I+OsPdDg4cPU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037