UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N2MvjeaAG9PUfIM/9tUaHU25kRmGCyMNH4UKp27/TSw=' 
WHERE 
  key_id = '19c6023b8b93241b6bfd119f270df342a1c89e874d8f60472d265a0d6977f96a' 
  AND (
    token = 'N2MvjeaAG9PUfIM/9tUaHU25kRmGCyMNH4UKp27/TSw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034