UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6cah4arGAV2mkMCVGwPVeQRCP/LpwEUteVdQLGiwCtU=' 
WHERE 
  key_id = '5f1c86ba6301fefd6d575f4c1547c4b14901b290ec8e897dcb4718c6c11502ff' 
  AND (
    token = '6cah4arGAV2mkMCVGwPVeQRCP/LpwEUteVdQLGiwCtU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028