UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dBHC8kd15t9TFTvlYP2VcnRcEWM3I0tBS1QVqRKtWig=' 
WHERE 
  key_id = '1c4270e2df63d80442671164145b19a1629a03d1716fb9cd5f2aea894f685cf2' 
  AND (
    token = 'dBHC8kd15t9TFTvlYP2VcnRcEWM3I0tBS1QVqRKtWig=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00053