UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K3baGO5rWP8ETNsmp4zG7nXGCuxRsidKSEUQiM6hdJ0=' 
WHERE 
  key_id = 'c59a8b94ea8dcbfd1a3cb97d4df6188aaef21121b3eeedb6902983a1ac5e3aed' 
  AND (
    token = 'K3baGO5rWP8ETNsmp4zG7nXGCuxRsidKSEUQiM6hdJ0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032