UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7rS1iRNPYDTkbWUYXg/xo+ChcfT0iTbLBMsmh4N/kuI=' 
WHERE 
  key_id = '82170c46e0c4b2d8affe621af4e1fc4fa2920cc0523cf6ee9d4f2d1a1bc7112c' 
  AND (
    token = '7rS1iRNPYDTkbWUYXg/xo+ChcfT0iTbLBMsmh4N/kuI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029