UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/HfRcoEUJJ52rg4oe+I5+VaJO7KteBRwJC0LorK6Wl8=' 
WHERE 
  key_id = '8b1088290e8e6321be6b169db9083cf703a088a6463cc3b286a4542ccece337b' 
  AND (
    token = '/HfRcoEUJJ52rg4oe+I5+VaJO7KteBRwJC0LorK6Wl8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042