UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pLaI4TJHtorlQNYzMHdaYOr6Gk0rBCurU0iCjM5jrh0=' 
WHERE 
  key_id = '2a96b999872c8ba241d7238443894f2e87caa84142b8cefe34dfc15aa1077915' 
  AND (
    token = 'pLaI4TJHtorlQNYzMHdaYOr6Gk0rBCurU0iCjM5jrh0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047