UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VnFYsyD/9X98A54KExLeNtP9b/Gl1mR5tbJKsUuATiU=' 
WHERE 
  key_id = '2544145d3579c317b53df38425d2121a064d17d96d2b4174b2e9b4fa5e6d9596' 
  AND (
    token = 'VnFYsyD/9X98A54KExLeNtP9b/Gl1mR5tbJKsUuATiU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031