UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dM+/q0PE60UUFUsvQshd+d85sQtb70XqSOdL14IA/+M=' 
WHERE 
  key_id = 'abfff1306d29e8db6598063654d1824d12b5f83438a1f13aba523ffb4a0bd47d' 
  AND (
    token = 'dM+/q0PE60UUFUsvQshd+d85sQtb70XqSOdL14IA/+M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017