UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hFbR78vsQiCvWy16a9kGMoZr6xYh6veQzlOL9+zdrBM=' 
WHERE 
  key_id = 'cf99175b12829992fa84169f5bede8e4296ef354bede02406073168e0a3ac635' 
  AND (
    token = 'hFbR78vsQiCvWy16a9kGMoZr6xYh6veQzlOL9+zdrBM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029