UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '84X14Rt5dSOKFUBeROoRs7bsGFKX+Y12SmK7DyVZDfY=' 
WHERE 
  key_id = '24ed67e1a4e2a15bc44373c47295ef2af6b3568d5010f6e854b6b481b7105a67' 
  AND (
    token = '84X14Rt5dSOKFUBeROoRs7bsGFKX+Y12SmK7DyVZDfY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031