UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dqU3bEZQGumbmQFE1Eq++F6H1w4qWrXXBQGm6/5wI1Y=' 
WHERE 
  key_id = '458d0f614028b094ff2e534cec491c5af7df9a047ccd7d376aebcd12fce4ae35' 
  AND (
    token = 'dqU3bEZQGumbmQFE1Eq++F6H1w4qWrXXBQGm6/5wI1Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021