UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Vr2OgAd0ktod/hWEweLMdywuI7yrhCYAJnvlYaEYMo4=' 
WHERE 
  key_id = '2fc1e91f134d70c2680961df6bc6a5b92444ca41cb31d80e07cd74f2d378a146' 
  AND (
    token = 'Vr2OgAd0ktod/hWEweLMdywuI7yrhCYAJnvlYaEYMo4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034