UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xgrt6b/5GQQNC2CZbu9GJvZl3zAlRxsYedKuNl1RKG0=' 
WHERE 
  key_id = 'df23393ebc55a5952a5ec5928a6a931049e4a9fd4a09c603f1c42949a6ae6a85' 
  AND (
    token = 'xgrt6b/5GQQNC2CZbu9GJvZl3zAlRxsYedKuNl1RKG0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026