UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OTiMS5yfU4KDex7y8q7BU2RPAh+213rSL1AWc3hmZbQ=' 
WHERE 
  key_id = '98d3e7421410a37726bf34fdf3c26348dfb4dc35f24678606f9929894c745802' 
  AND (
    token = 'OTiMS5yfU4KDex7y8q7BU2RPAh+213rSL1AWc3hmZbQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033