UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eUH3u14Zix5IP2cRg+eA8EGN1LIupBuTNs2o8gCzfG8=' 
WHERE 
  key_id = 'aa82816919a96d2b43f3c60aec171221005408726698184bc925e7238c40e58c' 
  AND (
    token = 'eUH3u14Zix5IP2cRg+eA8EGN1LIupBuTNs2o8gCzfG8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00061