UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YhhoV9s4XnXBO+G+ZPpTnS64Ym1IQS49bL1lAhBPz/M=' 
WHERE 
  key_id = '8bad1597b036a095343f6ac2ea6efadf58e39d709e1f626da959474df3fee399' 
  AND (
    token = 'YhhoV9s4XnXBO+G+ZPpTnS64Ym1IQS49bL1lAhBPz/M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032